<?php
namespace app\api\controller;

class Oauth extends Base
{
    protected $autoNewModel = false;// 是否自动实例化当前模型
//    protected $autoValidateCheck = false;// 是否开启自动验证

    public function information()
    {
        //整理数据
        $data = [
            'logo'=> get_oss_url('static/system/logo.png'),
            'main_title'=> '登录',
            'title'=> '众益 ',
            'description'=>'请使用手机号码进行登录',
            'wechat'=>[
                'enable'=> false, 'title'=> '', 'alias'=> '', 'show'=> false, 'tip'=> ''
            ],
            'third_platform'=> [
                'enable'=> false,
                'providers'=> [
                    [
                        'alias'=> 'sinaweibo',
                        'logo'=> ''
                    ],
                    [
                        'alias'=> 'weixin',
                        'logo'=> ''
                    ],
                    [
                        'alias'=> 'qq',
                        'logo'=> ''
                    ]
                ]
            ],
        ];
        return showSuccess($data);
    }

    public function mobileLogin()
    {
        //手机验证码登录
//        dd($request->UserModel->id);
        $user = cms_login([
            'data'=>request()->UserModel,
            'tag'=>'user'
        ]);
        return showSuccess($user);
    }

    public function login()
    {
        //账号密码登录
        $user = cms_login([
            'data'=>request()->UserModel,
            'tag'=>'user'
        ]);
        return showSuccess($user);
    }
}